home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
tegl6b.zip
/
INTROPAK.EXE
/
lha
/
TWCOMMON.DOC
< prev
next >
Wrap
Text File
|
1991-08-16
|
7KB
|
209 lines
{-----------------------------------------------------------------------------}
{ TEGL Windows ToolKit II }
{ Copyright (C) 1990, 1991 TEGL Systems Corporation }
{ All Rights Reserved. }
{-----------------------------------------------------------------------------}
{$I switches.inc}
UNIT twCommon;
INTERFACE
USES
errorlog,
videochk,
tgi,
FastGrph,
{$IFDEF NoGr}
TGraph,
{$ELSE}
graph,
{$ENDIF}
TEGLFont,
winicons,
VirtMem,
TeglMain,
teglicon,
TeglUnit;
CONST
twMaxHeaderLen = 40; { -- maximum header string length. }
twMinX : Word = 100; { -- global initialization values for }
twMinY : Word = 60; { -- for windows. Can be overridden. }
twMaxX : Word = 640;
twMaxY : Word = 480;
twBorderColor : Integer = Black;
twHeaderColor : Integer = Yellow;
twFrameColor : Integer = LightGray;
twFrameColor2 : Integer = DarkGray;
twFillColor : Integer = White;
twTextColor : Integer = Black;
twTextBackGround : Integer = White;
twThickness : Integer = 4;
twMoveable : Boolean = TRUE; {-- window are moveable by default }
twResize : Boolean = TRUE;
twBlockChar : word = 219; {-- the block character is used for }
{-- for blanking a character cell }
{-- before writing a character to it.}
twClipping : Boolean = TRUE; {-- graphics operations to be clipped }
{-- within window. }
{-- dialog CONSTANTS}
tdnothing = 00; {-- marker to break apart clusters }
tdlabel = 01;
tdbutton = 02; {-- button, like OK or CANCEL }
tdiconbutton = 03; {-- button, custom }
tdradiobutton = 04; {-- radio buttons ( ) ( ) (*) }
tdcheckbox = 05; {-- check boxes [X] [X] [ ] }
tduserdefined = 06; {-- actually they start here }
TYPE
{-- Standard frame drawing routine. }
FrameDrawFunc = Procedure (x1,y1,x2,y2,thickness,
border,uppershade,lowershade,fill: Integer);
{-- Declare the type of float world coordinate system uses if it is }
{-- defined. }
{$IFDEF twWorld}
{$IFDEF wcFloatLInt}
wcFloat = LongInt;
{$ELSE} {$IFDEF wcFloatReal}
wcFloat = Real;
{$ELSE} {$IFDEF wcRealSingle}
wcFloat = Single;
{$ELSE} {$IFDEF wcRealDouble}
wcFloat = Double;
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
twpoints = record x1,y1,x2,y2 : Integer; end;
graphVars = Record
x,y : Integer; { -- the CP }
Color : Word;
BkColor : Word;
LineSettings : LineSettingsType;
TextSettings : TextSettingsType;
FillSettings : FillSettingsType;
FillPattern : FillPatternType;
END;
CONST
twHeaderFont : Pointer = NIL;
twDialogFont : Pointer = NIL;
buth : byte = 16; { -- button height }
butw : byte = 16; { -- button width }
udslen : byte = 16; { -- slider length }
lrslen : byte = 16; { -- left right slider length }
resizeh : byte = 16; { -- resize area height }
resizew : byte = 16; { -- resize area width }
{..WFICON
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XFXX0FXXXXXXXXXXXXXXXXXXXXX0 X X
XF0F0FXXXX0XXXXXXXXXXFXXXXX0 XX80 XX80XX
XFXX0FXXXXXXXXXXXXXXXXXXXXX08XXX08XXX0XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X XXX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0XXXXXXX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0X8XX0XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X7XX08XXXXXXXXXXXXXXXXXXXXXX07XX0X7XX0XX
X8XX08XXXXXXXXXXXXXXXXXXXXXX08XX0X8XX0XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
}
ImageWFICON : array [0..385] of byte =
($80,$01,
$81,$01,$26, $01,$02, $82,$82,$0F,$04, $05,$82,$00,
$86,$82,$0F,$1B, $1C,$82,$00, $21,$02, $26,$02,
$01,$03, $02,$83,$0F, $03,$83,$00, $04,$83,$0F,
$05,$83,$00, $86,$83,$0F,$0A, $8B,$83,$00,$15, $96,$83,$0F,$1B,
$1C,$83,$00, $9E,$03,$1F, $20,$83,$08, $21,$83,$00,
$A3,$03,$24, $25,$83,$08, $A6,$83,$00,$28, $01,$04,
$82,$84,$0F,$04, $05,$84,$00, $86,$84,$0F,$1B, $1C,$84,$00,
$9D,$84,$08,$20, $21,$84,$00, $A2,$84,$08,$25, $A6,$84,$00,$28,
$81,$05,$28, $01,$06, $82,$86,$0F,$20, $A1,$86,$00,$22,
$A6,$06,$28, $01,$07, $82,$87,$0F,$20, $A1,$87,$00,$22,
$A3,$87,$08,$25, $A6,$87,$00,$28, $01,$08, $82,$88,$0F,$20,
$A1,$88,$00,$28, $01,$09, $82,$89,$0F,$20, $A1,$89,$00,$22,
$A3,$89,$08,$25, $A6,$89,$00,$28, $01,$0A, $82,$8A,$0F,$20,
$A1,$8A,$00,$22, $A3,$8A,$08,$25, $A6,$8A,$00,$28, $01,$0B,
$82,$8B,$0F,$20, $A1,$8B,$00,$22, $A3,$8B,$08,$25, $A6,$8B,$00,$28,
$01,$0C, $82,$8C,$0F,$20, $A1,$8C,$00,$22, $A3,$8C,$08,$25,
$A6,$8C,$00,$28, $01,$0D, $82,$8D,$0F,$20, $A1,$8D,$00,$22,
$A3,$8D,$08,$25, $A6,$8D,$00,$28, $01,$0E, $82,$8E,$0F,$20,
$A1,$8E,$00,$22, $A3,$8E,$08,$25, $A6,$8E,$00,$28, $01,$0F,
$82,$8F,$0F,$20, $A1,$8F,$00,$22, $A3,$8F,$08,$25, $A6,$8F,$00,$28,
$01,$10, $82,$90,$0F,$20, $A1,$90,$00,$22, $A3,$90,$08,$25,
$A6,$90,$00,$28, $01,$11, $82,$91,$0F,$20, $A1,$91,$00,$22,
$A3,$91,$08,$25, $A6,$91,$00,$28, $81,$12,$28, $01,$13,
$82,$93,$07,$04, $05,$93,$00, $86,$93,$08,$1C, $1D,$93,$00,
$9E,$93,$07,$20, $A1,$93,$00,$22, $A3,$93,$07,$25, $A6,$93,$00,$28,
$01,$14, $82,$94,$08,$04, $05,$94,$00, $86,$94,$08,$1C,
$1D,$94,$00, $9E,$94,$08,$20, $A1,$94,$00,$22, $A3,$94,$08,$25,
$A6,$94,$00,$28, $81,$15,$28, $83,$16,$28, $83,$17,$28 );
VAR
twlfbut : pointer;
twrtbut : pointer;
twupbut : pointer;
twdnbut : pointer;
twudbut : pointer;
twcrbut : pointer;
function twExitOption(ifs : Imagestkptr; ms : msclickptr): Word;
Procedure EmergencyExit;
Procedure twEasyStart;
Procedure twFit(VAR i,i1: Word; max : Word);
Procedure twFitFrame(VAR x,y,width,height : Word);
Procedure twSetGlobalButtonSize(width,height : byte);
Procedure twSetGlobalButtonIcons(left,right,up,down,updown,corner : pointer);
Procedure twSetGlobalSliderSize(updown,leftright : byte);
Procedure twSetGlobalResizearea(width,height :byte);
Procedure twSetGlobalMinMax(minx_,miny_,maxx_,maxy_ : Word);
Procedure DrawSliderBackGround(x1, y1, x2, y2 : Integer);
Procedure ErrMess(x,y: Integer; s: String);
procedure lineset(x1,y1,x2,y2,c1,c2 : Integer);
Procedure FilledRectangle(x,y,x1,y1,BorderColor,Fill,Color : Word);
Procedure StdBox(x1,y1,x2,y2,thickness,border,
edgefill,discard,fill: Integer);
Procedure BevBox(x1,y1,x2,y2,thickness,border,
uppershade,lowershade,fill: Integer);
Procedure GetGraphSettings(VAR gs : graphVars);
Procedure SetGraphSettings(VAR gs : graphVars);
Procedure twSetDialogFont(Font : pointer);
Procedure twSetHeaderFont(Font : pointer);
IMPLEMENTATION